home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
2207
/
2207.xpi
/
chrome
/
cooliris.jar
/
content
/
cooliris
/
bindings
/
cpvwBinding.xml
Wrap
Extensible Markup Language
|
2010-01-14
|
21KB
|
469 lines
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:html = "http://www.w3.org/1999/xhtml">
<binding id="cpvwFrame">
<resources>
<stylesheet src="chrome://cooliris/skin/cooliris.css"/>
</resources>
<content>
<xul:stack>
<xul:browser position="1" style="background-color: transparent;"/>
<xul:vbox anonid="cooliris-border-frame" flex="1" xbl:inherits="class=skin" style="margin:1px;">
<xul:vbox anonid="cooliris-toolbar" flex="1" class="cooliris-toolbar">
<xul:hbox anonid="cooliris-preview-toolbar" xbl:inherits="skin" class="cooliris-preview-toolbar" onmousedown="document.getBindingParent(this).startFrameDrag(event);" >
<xul:spacer width="5px"/>
<xul:image class="cooliris_logo" style="cursor:pointer;" ondblclick="cpvw_previewHandler.openCoolirisWebsite(event);"/>
<xul:spacer width="12px"/>
<xul:image id="cooliris_btnBack" height="21px" style="height:21px;" xbl:inherits="goBack=goBack" class="cooliris_btnBack" tooltiptext="Go back" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" onclick="cpvw_previewHandler.goBack(event);"/>
<xul:image id="cooliris_next" class="cooliris_next" xbl:inherits="goForward=goForward" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" tooltiptext="Go forward" onclick="cpvw_previewHandler.gotoNextLink();"/>
<xul:spacer width="5px"/>
<xul:image id="cooliris_openTab" class="cooliris_openTab" tooltiptext="Open to tab" onclick="cpvw_previewHandler.openLink(event);" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" />
<xul:image id="cooliris_stack" class="cooliris_stack" tooltiptext="Temporary bookmark to stack" onclick="this.removeAttribute('clicked');cpvw_previewHandler.addToStack();" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" />
<xul:image id="cooliris_openPiclensLite" class="cooliris_piclenslite" xbl:inherits="hasCooliris=hasCooliris,tooltiptext=slideshowTip" onclick="setTimeout(function(){cpvw_previewHandler.openPiclensLite();}, 100);" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" />
<xul:spacer width="5px"/>
<xul:image id="cooliris_sendToButton" class="cooliris_sendToButton" tooltiptext="Email current link" onclick="CoolirisFramePanel.showSendTo(event, true);" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" />
<xul:spacer width="8px"/>
<xul:image id="cooliris_zoom" class="cooliris_zoom" popup="cooliris_zoom_popup" tooltiptext="Zoom in/out" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" />
<xul:image id="cooliris_useroptions" class="cooliris_useroptions" tooltiptext="Customize speed, theme, and settings" onclick="cpvw_Prefs.showPrefDialog(event);" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" />
<xul:spacer flex="1"/>
<xul:spacer width="5px"/>
<xul:image anonid="cooliris_pushPin" class="cooliris_pushPin" tooltiptext="Keep preview window open" onclick="cpvw_previewHandler.togglePushPin();"/>
<xul:image id="cooliris_close" class="cooliris_close" tooltiptext="Close the preview" onclick="cpvw_previewHandler.hidePreview(true);"/>
<xul:spacer width="3px"/>
</xul:hbox>
<xul:hbox anonid="subSearchBar" xbl:inherits="skin" class="subSearchBar" hidden="true">
<xul:hbox class="subSearchWord">
<xul:hbox class="searchTextImage">
<xul:textbox anonid="subSearchBarText" class="subSearchText" onkeypress="if (event.keyCode == 13) cpvw_subSearchBar.doSearch();" ></xul:textbox>
</xul:hbox>
<!--<xul:label class="subSearchLabel" value="Search for"></xul:label>
<xul:label class="subSearchLabel" style="margin-left:0px;min-width:20px;max-width:80px;font-weight:bold;" crop="end" anonid="subSearchBarLabel" value=""></xul:label>
<xul:label class="subSearchLabel" style="margin-left:0px;" value="in:"></xul:label>
-->
</xul:hbox>
<xul:hbox anonid="subSearchBarContent">
</xul:hbox>
<xul:spacer flex="1"/>
<xul:label id="cooliris_subsearch_close" class="subSearchButton" style="margin-left:0px;" value="Close" tooltiptext="Hide the QuickSearch bar" onclick="document.getBindingParent(this).toggleSearchBar(false, '');"/>
</xul:hbox>
</xul:vbox>
<xul:hbox anonid="browser-box" flex="1">
<xul:hbox>
<xul:browser hidden="true" style="width:0px;height:0px;margin-right:1px;" src="" class="cooliris-browser" anonid="cpvw_leftAdFrame" disablehistory="false" type="content" context="contentAreaContextMenu"/>
</xul:hbox>
<xul:vbox flex="1">
<xul:browser hidden="true" style="width:0px;height:0px;margin-bottom:2px;" src="" class="cooliris-browser" anonid="cpvw_topAdFrame" disablehistory="false" type="content" context="contentAreaContextMenu"/>
<xul:browser class="cooliris-browser" anonid="cooliris-preview-frame" disablehistory="false" type="content" context="contentAreaContextMenu"/>
<xul:browser hidden="true" class="cooliris-browser" style="width:0px;height:0px;margin-top:1px;" src="" anonid="cpvw_bottomAdFrame" disablehistory="false" type="content" context="contentAreaContextMenu"/>
<xul:browser style="width:0px;height:0px;" src="" xbl:inherits="src=statsUrl" class="cooliris-browser" anonid="cpvw_statsFrame" disablehistory="false" type="content" />
</xul:vbox>
<xul:hbox>
<xul:browser hidden="true" style="width:0px;height:0px;margin-left:1px;" src="" class="cooliris-browser" anonid="cpvw_rightAdFrame" disablehistory="false" type="content" context="contentAreaContextMenu"/>
</xul:hbox>
</xul:hbox>
<xul:hbox class="cooliris-statusbar" anonid="cooliris_statusbar" flex="1" onmousedown="cpvw_previewHandler.startFrameDrag(event);">
<xul:image id="cooliris-preview-resize-left" class="cooliris_resize_left" onmousedown="cpvw_previewHandler.startResizeLeft(event);event.preventDefault();event.stopPropagation();"/>
<xul:spacer flex="1"/>
<xul:image id="cooliris-preview-resize" class="cooliris_resize_right" onmousedown="cpvw_previewHandler.startResize(event);event.preventDefault();event.stopPropagation();"/>
</xul:hbox>
</xul:vbox>
</xul:stack>
</content>
<implementation>
<method name="_get">
<parameter name="elName"/>
<body>
return document.getAnonymousElementByAttribute(this, "anonid", elName);
</body>
</method>
<method name="setBgImage">
<parameter name="url"/>
<body>
document.getAnonymousElementByAttribute(this, "anonid", "cooliris-preview-toolbar").style.backgroundImage = "url(" + url + ")";
document.getAnonymousElementByAttribute(this, "anonid", "cooliris-preview-toolbar").style.backgroundRepeat = "repeat-x";
</body>
</method>
<field name="_pushPin"/>
<property name="pushPin">
<getter>return this._pushPin;</getter>
<setter>
this._pushPin = val;
if (val)
this._get("cooliris_pushPin").setAttribute("locked", "yes");
else
this._get("cooliris_pushPin").removeAttribute("locked");
</setter>
</property>
<field name="_forwardButtonDisabled"/>
<property name="forwardButtonDisabled">
<getter>return this._forwardButtonDisabled;</getter>
<setter>
this._forwardButtonDisabled = val;
if (val)
this._get("cooliris_next").setAttribute("disable", val);
else
this._get("cooliris_next").removeAttribute("disable");
</setter>
</property>
<property name="showSearchBar">
<getter>return _showSearchBar;</getter>
<setter>this._showSearchBar = val;</setter>
</property>
<field name="_showSearchBar"></field>
<method name="toggleSearchBar">
<parameter name="show"/>
<parameter name="searchString"/>
<body>
<![CDATA[
this._showSearchBar = show;
this._get("subSearchBar").hidden = !show;
cpvw_subSearchBar.toDisplaySearchBar = show;
if (this.isShowing)
{
//if (searchString.length > 20)
// searchString = searchString.substr(0, 20);
this._get("subSearchBarText").value = searchString;
this.showPopup(this.previewLeft, this.previewTop, this.previewWidth, this.previewHeight);
}
]]>
</body>
</method>
<method name="getPreviewFrame">
<body>
return this._get("cooliris-preview-frame");
</body>
</method>
<method name="getSearchBarContent">
<body>
return this._get("subSearchBarContent");
</body>
</method>
<method name="getSearchText">
<body>
return this._get("subSearchBarText").value;
</body>
</method>
<method name="setStatsUrl">
<parameter name="url"/>
<body>
this._get("cpvw_statsFrame").loadURI(url);
</body>
</method>
<method name="statsUrlReload">
<body>
this._get("cpvw_statsFrame").reload();
</body>
</method>
<method name="setPosition">
<parameter name="elName"/>
<parameter name="left"/>
<parameter name="top"/>
<parameter name="width"/>
<parameter name="height"/>
<body>
obj = document.getAnonymousElementByAttribute(this, "anonid", elName);
if (left)
obj.style.left = left + "px";
if (top)
obj.style.top = top + "px";
if (width)
obj.style.width = width + "px";
if (height)
obj.style.height = height + "px";
</body>
</method>
<field name="leftAdFrameSize">0</field>
<field name="rightAdFrameSize">0</field>
<field name="topAdFrameSize">0</field>
<field name="bottomAdFrameSize">0</field>
<field name="previewLeft"></field>
<field name="previewTop"></field>
<field name="previewWidth"></field>
<field name="previewHeight"></field>
<field name="isShowing"></field>
<method name="showPopupCollapsed">
<parameter name="left"/>
<parameter name="top"/>
<parameter name="width"/>
<parameter name="height"/>
<body>
this.hidden = false;
this.style.display = "block";
this.style.left = left + "px";
this.style.top = top + "px";
this.style.width = width + "px";
this.style.height = height + "px";
var iframeHeight = 1;
this.setPosition("cooliris-preview-frame", null, null, width, iframeHeight, true);
//conDump("FINAL DIMENSIONS = " + left + ", " + top + ", " + width + ", " + height);
</body>
</method>
<field name="_adVisible"/>
<method name="showAd">
<body>
<![CDATA[
var adId = cpvw_prefHandler.getPref(cpvw_Prefs.prefAdId);
var strGet = "&adId=" + adId + "&theme=" + cpvw_prefHandler.getPref(cpvw_Prefs.prefTheme) + "&version=" + cpvw_objStats.getAddonVersion(false);
var adUrl = cpvw_adManager.adServer;
//conDump("adframesize " + [this.leftAdFrameSize, this.rightAdFrameSize, this.topAdFrameSize, this.bottomAdFrameSize].join(", "));
this._adVisible = true;
this.showPopup(this.previewLeft, this.previewTop, this.previewWidth, this.previewHeight);
if (this.leftAdFrameSize > 0)
{
this._get("cpvw_leftAdFrame").setAttribute("src", adUrl + "?loc=left" + strGet);
this._get("cpvw_leftAdFrame").addEventListener("coolpreviewsCloseAdEvent", cpvw_adManager, false, true);
}
else
{
this._get("cpvw_leftAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
this._get("cpvw_leftAdFrame").hidden = true;
}
if (this.rightAdFrameSize > 0)
{
this._get("cpvw_rightAdFrame").setAttribute("src", adUrl + "?loc=right" + strGet);
this._get("cpvw_rightAdFrame").addEventListener("coolpreviewsCloseAdEvent", cpvw_adManager, false, true);
}
else
{
this._get("cpvw_rightAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
this._get("cpvw_rightAdFrame").hidden = true;
}
if (this.topAdFrameSize > 0)
{
this._get("cpvw_topAdFrame").setAttribute("src", adUrl + "?loc=top" + strGet);
this._get("cpvw_topAdFrame").addEventListener("coolpreviewsCloseAdEvent", cpvw_adManager, false, true);
}
else
{
this._get("cpvw_topAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
this._get("cpvw_topAdFrame").hidden = true;
}
if (this.bottomAdFrameSize > 0)
{
this._get("cpvw_bottomAdFrame").setAttribute("src", adUrl + "?loc=bottom" + strGet);
this._get("cpvw_bottomAdFrame").addEventListener("coolpreviewsCloseAdEvent", cpvw_adManager, false, true);
}
else
{
this._get("cpvw_bottomAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
this._get("cpvw_bottomAdFrame").hidden = true;
}
]]>
</body>
</method>
<method name="showPopup">
<parameter name="left"/>
<parameter name="top"/>
<parameter name="width"/>
<parameter name="height"/>
<parameter name="showAd"/>
<body>
<![CDATA[
this.hidden = false;
this.style.display = "block";
this.style.left = left + "px";
this.style.top = top + "px";
this.style.width = width + "px";
this.style.height = height + "px";
this.previewLeft = left;
this.previewTop = top;
this.previewWidth = width;
this.previewHeight = height;
var browserWidth = width;
var actualBrowserWidth = width;
var actualBrowserHeight = this._showSearchBar ? height - 70 : height - 43;
var browserHeight = this._showSearchBar ? height - 70 : height - 43;
var adFrameHeight, adFrameWidth;
if (this._adVisible)
{
if (this.leftAdFrameSize > 0)
{
this._get("cpvw_leftAdFrame").hidden = false;
//setTimeout(function(){ self._get("cpvw_leftAdFrame").setAttribute("src", adUrl + "?loc=left" + strGet); }, 500);
browserWidth = browserWidth - parseInt(this.leftAdFrameSize) - 1;
adFrameHeight = actualBrowserHeight;
<!--if (this.topAdFrameSize > 0)
adFrameHeight = this.topAdFrameSize - 1;
if (this.bottomAdFrameSize > 0)
adFrameHeight = this.bottomAdFrameSize - 1;
-->
this.setPosition("cpvw_leftAdFrame", null, null, this.leftAdFrameSize, adFrameHeight);
}
if (this.rightAdFrameSize > 0)
{
this._get("cpvw_rightAdFrame").hidden = false;
//setTimeout(function(){ self._get("cpvw_rightAdFrame").setAttribute("src", adUrl + "?loc=right" + strGet); }, 500);
browserWidth = browserWidth - parseInt(this.rightAdFrameSize) - 1;
adFrameHeight = actualBrowserHeight;
<!--if (this.topAdFrameSize > 0)
adFrameHeight = this.topAdFrameSize - 1;
if (this.bottomAdFrameSize > 0)
adFrameHeight = this.bottomAdFrameSize - 1;
-->
this.setPosition("cpvw_rightAdFrame", null, null, this.rightAdFrameSize, adFrameHeight);
}
if (this.topAdFrameSize > 0)
{
this._get("cpvw_topAdFrame").hidden = false;
//setTimeout(function(){ self._get("cpvw_topAdFrame").setAttribute("src", adUrl + "?loc=top" + strGet); }, 500);
browserHeight = browserHeight - parseInt(this.topAdFrameSize) - 1;
adFrameWidth = actualBrowserWidth;
if (this.leftAdFrameSize > 0)
adFrameWidth = this.leftAdFrameSize - 1;
if (this.rightAdFrameSize > 0)
adFrameWidth = this.rightAdFrameSize - 1;
this.setPosition("cpvw_topAdFrame", null, null, adFrameWidth, this.topAdFrameSize);
}
if (this.bottomAdFrameSize > 0)
{
this._get("cpvw_bottomAdFrame").hidden = false;
//setTimeout(function(){ self._get("cpvw_bottomAdFrame").setAttribute("src", adUrl + "?loc=bottom" + strGet); }, 500);
browserHeight = browserHeight - parseInt(this.bottomAdFrameSize) - 1;
adFrameWidth = actualBrowserWidth;
if (this.leftAdFrameSize > 0)
adFrameWidth = this.leftAdFrameSize - 1;
if (this.rightAdFrameSize > 0)
adFrameWidth = this.rightAdFrameSize - 1;
this.setPosition("cpvw_bottomAdFrame", null, null, adFrameWidth, this.bottomAdFrameSize);
}
}
this.isShowing = true;
this.setPosition("cooliris-preview-frame", null, null, browserWidth, browserHeight, true);
//conDump("FINAL DIMENSIONS = " + left + ", " + top + ", " + width + ", " + height + ", " + browserHeight);
]]>
</body>
</method>
<method name="hidePopup">
<body>
if (this._adVisible)
{
if (this.leftAdFrameSize > 0)
{
this._get("cpvw_leftAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
this._get("cpvw_leftAdFrame").hidden = true;
}
if (this.rightAdFrameSize > 0)
{
this._get("cpvw_rightAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
this._get("cpvw_rightAdFrame").hidden = true;
}
if (this.topAdFrameSize > 0)
{
this._get("cpvw_topAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
this._get("cpvw_topAdFrame").hidden = true;
}
if (this.bottomAdFrameSize > 0)
{
this._get("cpvw_bottomAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
this._get("cpvw_bottomAdFrame").hidden = true;
}
}
this._adVisible = false;
var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULAppInfo);
var versionChecker = Components.classes["@mozilla.org/xpcom/version-comparator;1"]
.getService(Components.interfaces.nsIVersionComparator);
if (versionChecker.compare(appInfo.version, "3.0") >= 0)
this.getPreviewFrame().loadURI("chrome://cooliris/content/coolirisBlank.htm");
else
this.getPreviewFrame().setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
this._get("cpvw_statsFrame").loadURI("chrome://cooliris/content/coolirisBlank.htm");
//this.getPreviewFrame().loadURI("chrome://cooliris/content/coolirisBlank.htm");
this.isShowing = false;
this.hidden = true;
this.style.display = "none";
</body>
</method>
<field name="dragActive"/>
<field name="moveFrameFunc"/>
<field name="stopFrameFunc"/>
<method name="startFrameDrag">
<parameter name="evt"/>
<body>
if (this.dragActive)
return;
cpvw_previewHandler.curMouseLocX = evt.screenX;
cpvw_previewHandler.curMouseLocY = evt.screenY;
this._get("cooliris-toolbar").style.cursor = "-moz-grabbing";
this._get("cooliris_statusbar").style.cursor = "-moz-grabbing";
var self = this;
this.moveFrameFunc = function(evt){ self.moveFrame(evt); };
this.stopFrameFunc = function(evt){ self.stopFrameDrag(evt); };
window.addEventListener("mouseup", this.stopFrameFunc, true);
window.addEventListener("mousemove", this.moveFrameFunc, true);
this.dragActive = true;
</body>
</method>
<method name="stopFrameDrag">
<parameter name="evt"/>
<body>
if (!this.dragActive)
return;
window.removeEventListener("mouseup", this.stopFrameFunc, true);
window.removeEventListener("mousemove", this.moveFrameFunc, true);
cpvw_previewHandler.changeDimensions(cpvw_previewHandler.dimPreview.left, cpvw_previewHandler.dimPreview.top,
cpvw_previewHandler.dimPreview.width, cpvw_previewHandler.dimPreview.height, true);
this._get("cooliris-toolbar").style.cursor = "";
this._get("cooliris_statusbar").style.cursor = "";
cpvw_Prefs.setPreviewLoc(cpvw_previewHandler.dimPreview.left, cpvw_previewHandler.dimPreview.top);
this.dragActive = false;
</body>
</method>
<method name="moveFrame">
<parameter name="evt"/>
<body>
if (!this.dragActive)
return;
cpvw_previewHandler.dimPreview.left += evt.screenX - cpvw_previewHandler.curMouseLocX;
cpvw_previewHandler.dimPreview.top += evt.screenY - cpvw_previewHandler.curMouseLocY;
cpvw_previewHandler.curMouseLocX = evt.screenX;
cpvw_previewHandler.curMouseLocY = evt.screenY;
cpvw_previewHandler.changeDimensions(cpvw_previewHandler.dimPreview.left, cpvw_previewHandler.dimPreview.top,
cpvw_previewHandler.dimPreview.width, cpvw_previewHandler.dimPreview.height, true);
</body>
</method>
</implementation>
<handlers>
</handlers>
</binding>
</bindings>